class NotificationStream():

    def __init__(self, notifications, criteria):
        self.__notifications = notifications
        self.__criteria = criteria
        self.__next = 0

    def has_matched(self):
        while (self.next < len(self.notifications)):
            if (self.criteria.matches(self.notifications[self.next])):
                return True
            self.next += 1
        return False;

    @property
    def notifications(self):
        return self.__notifications

    @property
    def criteria(self):
        return self.__criteria

    @property
    def next(self):
        return self.__next
    
    @next.setter
    def next(self, value):
        self.__next = value
        
